package org.eda.act2;


public class Persona {
	
	// atributos
	private String name;
    private String dni;
	
	public Persona(String pName, String pDni) { // Constructora
		name = pName;
		dni = pDni;
	}
	
	public String getName() { return name; }

	public void setName(String name) { this.name = name; }

	public String getDni() { return dni; }

	public void setDni(String dni) { this.dni = dni; }
	
	public boolean equals(Object o) {
		  if ( this == o ) return true;
		  if ( !(o instanceof Persona) ) return false;
		  Persona p = (Persona)o;
		  return dni.equals(p.getDni());
	}
		
	public String toString() {
		return name + " " + dni;
	}
	
} // end Persona
